<template>
	<view class="content">
		<view style="height: 600rpx;" v-if="list.length==0">
			<u-empty text="暂无消息" mode="message"></u-empty>
		</view>
		<view class="item" v-for="(item,index) in list" v-else>
			<view class="time">{{item.created_at||'...'}}</view>
			<view class="context">{{item.content||'...'}}</view>
		</view>
	</view>
</template>

<script>
	import {noticeList} from '../../common/api.js'
	export default {
		data() {
			return {
				list:[],
				item:{}
			}
		},
		onLoad(e) {
			this.getList(e.type)
		},
		methods: {
			getList(type){
				noticeList({
					type
				}).then(res=>{
					if(res.code==10000){
						this.list = res.data.list
					}
				})
			}
		}
	}
</script>
<style>
	page{
		background: #EDEFF2;
	}
</style>
<style scoped lang="scss">
.content{
	width: 750rpx;
	padding: 32rpx;
	box-sizing: border-box;
	.item{
		margin-bottom: 32rpx;
		.time{
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			font-size: 24rpx;
			color: #999999;
			line-height: 24rpx;
			text-align: center;
			font-style: normal;
		}
		.context{
			background: #FFFFFF;
			border-radius: 20rpx;
			padding: 30rpx 32rpx;
			box-sizing: border-box;
			margin-top: 32rpx;
		}
	}
}
</style>
